<template>
  <h1>兄---{{ $store.state.num }}</h1>
  <button @click="changeNum">点击修改 vuex 中 num</button>

</template>

<script setup>
import { useStore } from 'vuex';
const store = useStore()
function changeNum(){
  store.commit('addNum')
}
</script>